class Solution3340 {
    public boolean isBalanced(String num) {
        int sum = 0 ; 
        char[] arr = num.toCharArray() ;
        int len = arr.length ;
        for(int i=0 ; i < len ; i ++){
            if(i % 2 == 0){
              sum += arr[i] - '0' ; 
            }else{
               sum -= arr[i] -'0' ; 
            }
        }
       return sum == 0 ; 
    }
}